package com.createidea.cms.struts.action;

import java.util.List;

import com.createidea.cms.service.producttype.ProductTypeService;
import com.createidea.cms.to.ProductTypeTo;

public class ProductTypeAction extends BaseAction {
    private ProductTypeService productTypeService;
    private List<ProductTypeTo> types;
    private String productTypeId;
    private ProductTypeTo productType;
    
    
    public String maintainProductType(){
    	types=productTypeService.getProductTypes();
    	return SUCCESS;
    }
    
    public String addProductType(){
    	return SUCCESS;
    }
    
    public String editProductType(){
    	productType=productTypeService.getProductTypeById(productTypeId);
    	return SUCCESS;
    }
    
    public String saveProductType(){
    	productTypeService.saveProductType(productType);
    	return SUCCESS;
    }
    
	public ProductTypeService getProductTypeService() {
		return productTypeService;
	}

	public void setProductTypeService(ProductTypeService productTypeService) {
		this.productTypeService = productTypeService;
	}

	public List<ProductTypeTo> getTypes() {
		return types;
	}

	public void setTypes(List<ProductTypeTo> types) {
		this.types = types;
	}

	public String getProductTypeId() {
		return productTypeId;
	}

	public void setProductTypeId(String productTypeId) {
		this.productTypeId = productTypeId;
	}

	public ProductTypeTo getProductType() {
		return productType;
	}

	public void setProductType(ProductTypeTo productType) {
		this.productType = productType;
	}
	
	
    
}
